package org.example.config;

import jakarta.annotation.Resource;
import org.example.interceptor.FirstInterceptor;
import org.example.interceptor.Secondnterceptor;
import org.example.interceptor.ThirdInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class SpringMVCConfig implements WebMvcConfigurer {
    @Resource
    private FirstInterceptor firstInterceptor;
    @Resource
    private Secondnterceptor secondInterceptor;
    @Resource
    private ThirdInterceptor thirdInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(firstInterceptor).order(1).addPathPatterns("/**");
        registry.addInterceptor(secondInterceptor).order(76).addPathPatterns("/**");
        registry.addInterceptor(thirdInterceptor).order(57).addPathPatterns("/**");
    }
}
